image=compile_server_image
include_path=./include/jsoncpp:./include/seccomp
lib_path=./lib/jsoncpp:./lib/seccomp

compile.exe: compile_server.cc
	g++ -o $@ $^ -I$(include_path) -L$(lib_path) -std=c++11 -lpthread -ljsoncpp -lseccomp

.PHONY: clean
clean:
	rm -rf compile.exe

clean_log:
	rm -rf log

.PHONY: docker_clean
docker_clean:
	docker rm -f $$(docker ps -aq --filter "ancestor=$(image)")  # 删除所有使用指定镜像的容器
	docker rmi $(image)

# 进入 docker
.PHONY: docker_bash
docker_bash:
	docker exec -it compile_server-server-1 /bin/bash

#一键部署docker
.PHONY: docker
docker:
	docker compose up --build